<template>
  <div>我是子组件的自定义组件</div>
  <button @click="myClick">点击我来和父组件通信</button>
</template>

<script>
  import {ref} from 'vue'
  export default {
    name: 'zidingyi-components',
    emits: ['myEvent'],
    setup(props, {emit}) {
      const value = ref('')

      function myClick() {
        emit('myEvent', '我从自定义的组件里来的！')
      }

      return {
        value,
        myClick
      }
    }
  }
</script>

<style scoped>

</style>
